package org.xteam.camllight;

import org.xteam.camllight.io.FlushPrimitive;
import org.xteam.camllight.io.OpenDescriptor;
import org.xteam.camllight.io.OutputCharPrimitive;
import org.xteam.camllight.io.OutputPrimitive;
import org.xteam.camllight.str.CreateString;
import org.xteam.camllight.str.FillString;

public class Primitives {
	
	private static Primitive[] primitives = new Primitive[] {
		new DefaultPrimitive("compare"),
		new DefaultPrimitive("equal"),
		new DefaultPrimitive("notequal"),
		new DefaultPrimitive("lessthan"),
		new DefaultPrimitive("lessequal"),
		new DefaultPrimitive("greaterthan"),
		new DefaultPrimitive("greaterequal"),
		new DefaultPrimitive("extern_val"),
		new DefaultPrimitive("extern_compact_val"),
		new DefaultPrimitive("format_float"),
		new DefaultPrimitive("float_of_string"),
		new DefaultPrimitive("exp_float"),
		new DefaultPrimitive("fabs_float"),
		new DefaultPrimitive("floor_float"),
		new DefaultPrimitive("fmod_float"),
		new DefaultPrimitive("frexp_float"),
		new DefaultPrimitive("ldexp_float"),
		new DefaultPrimitive("log_float"),
		new DefaultPrimitive("log10_float"),
		new DefaultPrimitive("modf_float"),
		new DefaultPrimitive("sqrt_float"),
		new DefaultPrimitive("power_float"),
		new DefaultPrimitive("sin_float"),
		new DefaultPrimitive("sinh_float"),
		new DefaultPrimitive("cos_float"),
		new DefaultPrimitive("cosh_float"),
		new DefaultPrimitive("tan_float"),
		new DefaultPrimitive("tanh_float"),
		new DefaultPrimitive("asin_float"),
		new DefaultPrimitive("acos_float"),
		new DefaultPrimitive("atan_float"),
		new DefaultPrimitive("atan2_float"),
		new DefaultPrimitive("ceil_float"),
		new DefaultPrimitive("gc_stat"),
		new DefaultPrimitive("gc_get"),
		new DefaultPrimitive("gc_set"),
		new DefaultPrimitive("gc_minor"),
		new DefaultPrimitive("gc_major"),
		new DefaultPrimitive("gc_full_major"),
		new HashUnivParam(), // new DefaultPrimitive("hash_univ_param"),
		new DefaultPrimitive("intern_val"),
		new DefaultPrimitive("int_of_string"),
		new DefaultPrimitive("format_int"),
		new OpenDescriptor(), // new DefaultPrimitive("open_descriptor"),
		new DefaultPrimitive("channel_descriptor"),
		new DefaultPrimitive("channel_size"),
		new FlushPrimitive(), // new DefaultPrimitive("flush"),
		new OutputCharPrimitive(), // new DefaultPrimitive("output_char"),
		new DefaultPrimitive("output_int"),
		new OutputPrimitive(), // new DefaultPrimitive("output"),
		new DefaultPrimitive("seek_out"),
		new DefaultPrimitive("pos_out"),
		new DefaultPrimitive("close_out"),
		new DefaultPrimitive("input_char"),
		new DefaultPrimitive("input_int"),
		new DefaultPrimitive("input"),
		new DefaultPrimitive("seek_in"),
		new DefaultPrimitive("pos_in"),
		new DefaultPrimitive("close_in"),
		new DefaultPrimitive("input_scan_line"),
		new DefaultPrimitive("get_next_char"),
		new DefaultPrimitive("start_interp"),
		new DefaultPrimitive("realloc_global"),
		new DefaultPrimitive("static_alloc"),
		new DefaultPrimitive("static_free"),
		new DefaultPrimitive("static_resize"),
		new DefaultPrimitive("obj_is_block"),
		new DefaultPrimitive("obj_block"),
		new DefaultPrimitive("available_primitives"),
		new DefaultPrimitive("parse_engine"),
		new CreateString(), // new DefaultPrimitive("create_string"),
		new DefaultPrimitive("compare_strings"),
		new DefaultPrimitive("blit_string"),
		new FillString(), // new DefaultPrimitive("fill_string"),
		new DefaultPrimitive("is_printable"),
		new SysExitPrimitive(), // new DefaultPrimitive("sys_exit"),
		new DefaultPrimitive("sys_open"),
		new DefaultPrimitive("sys_close"),
		new DefaultPrimitive("sys_remove"),
		new DefaultPrimitive("sys_rename"),
		new DefaultPrimitive("sys_chdir"),
		new DefaultPrimitive("sys_getenv"),
		new DefaultPrimitive("sys_system_command"),
		new DefaultPrimitive("sys_time"),
		new DefaultPrimitive("sys_catch_break"),
	};

	public static Primitive get(int primNum) {
		return primitives[primNum];
	}

}
